package org.jeecg.config.wlhy;


import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.Jeepay;
import com.jeequan.jeepay.JeepayClient;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.constant.enums.BaiduErrorCode;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.concurrent.TimeUnit;

import static org.jeecg.config.wlhy.OkHttp.HTTP_CLIENT;

@Configuration
@Slf4j
@Data
public class JeepayConfig {

    @Value("${jeepay.appId}")
    private String APP_ID;

    @Value("${jeepay.apiKey}")
    private String API_KEY;

    @Value("${jeepay.apiBase}")
    private String API_BASE;

    @Value("${jeepay.mchNo}")
    private String MCH_NO;

    @PostConstruct
    public void init() {
        Jeepay.setApiBase(API_BASE);
        Jeepay.apiKey = API_KEY;
        Jeepay.mchNo = MCH_NO;
        Jeepay.appId = APP_ID;
        log.info("JeepayConfig bean initialized successfully!");
    }

}
